﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAO;
using DTO;

namespace Banking.Nhân_viên
{
    public partial class DangKyKhachHangDoanhNghiep : UserControl
    {
        KhachHang khDTO;
        public DangKyKhachHangDoanhNghiep(KhachHang kh)
        {
            InitializeComponent();
            khDTO = kh;
        }

        private void DangKyKhachHangDoanhNghiep_Load(object sender, EventArgs e)
        {
            if (khDTO != null)
            {
                cmbChiNhanh.Text = khDTO.TruSo.Ten;
                txtMaKH.Text = khDTO.MaKH.ToString();
                txtHoTen.Text = khDTO.Ten;
                txtDiaChi.Text = khDTO.DiaChi;
                txtDienThoai.Text = khDTO.SoDT;
                txtMST.Text = khDTO.MaSoThue.ToString();
                txtNguoiDaiDien.Text = khDTO.NguoiDaiDien;
                txtGPKD.Text = khDTO.GiayPhepKinhDoanh;
                cmbChiNhanh.Enabled = false;
                pnMain.Text = "Thông Tin Doanh Nghiệp";
            }
            else
            {
                DataTable dt = NhanVienDAO.DSTruSo();
                cmbChiNhanh.DataSource = dt;
                cmbChiNhanh.DisplayMember = "Ten";
                cmbChiNhanh.ValueMember = "MaTruSo";
            }
        }
    }
}
